<?php

namespace app\admin\validate;

use think\Validate;

class User extends Validate
{
    protected $rule = [

        'tel' => 'require|length:11',
        'pass' => 'require|min:6',
        'repass' => 'require|confirm:pass',
        'nickname' => 'require|min:1|max:15',

    ];

    protected $message = [

        'nickname.require' => '必须需填写昵称',
        'nickname.max' => '昵称长度应在6~30位',
        'nickname.min' => '昵称长度应在6~30位',
        'pass.require' => '必须填写密码',
        'pass.min' => '密码长度不能低于6位',
        'repass.confirm' => '两次密码输入不一致',
        'tel.length' => '手机号码格式不对',
    ];

    protected $scene = [
        'save' => ['tel','pass','repass','nickname'],
        'update' => ['nickname'],
    ];

}


